package com.chat.biz.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chat.api.dto.AuthFriendRelationPageDTO;
import com.chat.api.dto.AuthSetGroupDTO;
import com.chat.api.entity.FriendRelation;
import com.chat.api.vo.AuthFriendRelationPageVO;
import com.chat.biz.mapper.FriendRelationMapper;
import com.chat.common.threadLocal.UserContext;
import org.springframework.stereotype.Service;

/*
*功能：
 作者：chenhao
*日期： 2025/6/7 下午7:40
*/
@Service
public class FriendRelationService extends ServiceImpl<FriendRelationMapper, FriendRelation> {
    public Page<AuthFriendRelationPageVO> FriendRelationPage(Page page, AuthFriendRelationPageDTO dto) {
        Page<AuthFriendRelationPageVO> authFriendRelationPageVO = baseMapper.FriendRelationPage(page, dto);
        return authFriendRelationPageVO;
    }

    public void setgroup(AuthSetGroupDTO dto) {
        dto.setUserId(UserContext.getUserId().getUserId());
        baseMapper.setgroup(dto);
    }
}
